{extend name="public:common_index"/}
{block name="main"}
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title"><i class="fa fa-list"></i> {$title}</h3>
        </div>
        <div class="panel-body">
            <div class="navbar navbar-default">
                <form action="" id="search-form2" class="navbar-form form-inline" method="get" onsubmit="return false">
                    <label class="control-label" for="input-order-id">MIYOID</label>
                    <div class="input-group">
                        <input type="text" name="uuid" value="{$Think.get.uuid}" placeholder="MIYOID"
                               class="form-control">
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="input-order-id">搜索:</label>
                        <div class="input-group">
                            <input type="text" name="keyword" value="{$Think.get.keyword}" placeholder="抽奖人昵称或手机号"
                                   class="form-control">
                        </div>

                    </div>
                    <div class="form-group">
                        <label class="control-label" for="input-order-id">最低单价礼物:</label>
                        <div class="input-group">
                            <input type="number" name="price" value="{$Think.get.price}" placeholder="筛选最低单价记录" class="form-control">
                        </div>

                    </div>

                    <div class="form-group">
                    <label class="control-label" for="input-order-id">抽奖时间</label>
                    <div class="input-group">
                    <input type="text"   name="startDate"  autocomplete="off" value="{$Think.get.startDate}" placeholder="选择开始时间" class="form-control timepicker">
                    </div>
                    </div>
                    <div class="form-group">
                    <div class="input-group">
                    <input type="text"   name="endDate"  autocomplete="off" value="{$Think.get.endDate}" placeholder="选择结束时间"
                    class="form-control timepicker">
                    </div>
                    </div>
                    <button type="submit" onclick="javascript:document.getElementById('search-form2').submit();"
                            id="button-filter search-order" class="btn btn-primary"><i class="fa fa-search"></i> 筛选
                    </button>
                    <br />
                    <label class="control-label">中奖总价值:{$total}&nbsp&nbsp&nbsp抽奖总次数:{$allNum}&nbsp&nbsp&nbsp抽奖消耗钻石:{:$use}
                    奖金池:{$use - $total}
                     </label>




                    <!--<a href="{:url('examiner_batch')}" class="btn btn-primary pull-right"><i class="fa fa-folder-open-o"></i>批量导入</a>-->
                </form>
            </div>
            <div id="ajax_return">
                <form method="post" enctype="multipart/form-data" target="_blank" id="form-order">
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <td>序号</td>
                                <td>头像</td>
                                <td>昵称</td>
                                <td>MIYOID</td>
                                <td>手机号码</td>
                                <td>奖品价值</td>
                                <td>奖品类型</td>
                                <td>详细</td>
                                <td>类型</td>
                                <td>中奖时间</td>

                            </tr>
                            </thead>
                            <tbody>
                            <!-- 列表循环开始 -->
                            {volist name="rows" id="row" key="key"}
                            <tr>
                                <td>{$key}</td>
                                <td><img style="max-width: 80px;max-height: 80px;" src="{$row.header_img}" alt=""></td>
                                <td class="emojstext">{$row.nick_name}</td>
                                <td class="emojstext">{$row.uuid}</td>
                                <td class="emojstext">{$row.phone}</td>
                                <td>{$row.total}</td>
                                <td>{if $row.type == 1}礼物{else/}道具卡{/if}</td>
                                <td >{$row.detail}</td>
                                <td >{$row.remark}</td>
                                <td>{$row.create_time}</td>

                            </tr>
                            {/volist}
                            <!-- 列表循环结束 -->
                            </tbody>
                        </table>
                    </div>
                </form>
            </div>
            <div id='pagerarea'>{$pageHTML}</div>
        </div>
    </div>
{/block}

{block name="js"}
<script>
    $(document).delegate('.timepicker','focusin', function(){
        $('.timepicker').datetimepicker({
            format: 'yyyy-mm-dd',
            minView: "month",
            language:  'zh-CN',
            weekStart: 1,
            todayBtn:  0,
            autoclose: 1,
            startDate:'2015-01-01',
            maxView:3,
            endDate:0,
            todayHighlight: 1,
            startView: 2,
            forceParse: 0,
            showMeridian: 1
        });
    });

    $("#download").click(function () {
        $("input[name='download']").val('download');
        document.getElementById('search-form2').submit();
    });

    $(function () {

        $.each($('.emojstext'),function (k,v) {
            var $text = $(v);
            var html = $text.html().trim().replace(/\n/g, '<br/>');
            html = jEmoji.softbankToUnified(html);
            html = jEmoji.googleToUnified(html);
            html = jEmoji.docomoToUnified(html);
            html = jEmoji.kddiToUnified(html);
            $text.html(jEmoji.unifiedToHTML(html));
        });



        var type   = "{$Think.get.type}";
        if(type != ''){
            $('#type'+type).attr('selected',true)
        }

        var status   = "{$Think.get.status}";
        if(status != ''){
            $('#status'+status).attr('selected',true)
        }
    })

</script>



{/block}



